home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / MAGS.ZIP / VLAD#3.ZIP / ARTICLE.3_5 < prev    next >
Encoding:
Text File  |  1995-02-01  |  25.6 KB  |  696 lines

  1.             T B A V   M O N I T O R
  2.                    Written by
  3.                   Darkman/VLAD
  4.  
  5.   Thanks for the idea to Conzouler and The Unforgiven of Immortal Riot
  6.           Read Immortal Riot's magazine Insane Reality
  7.  
  8.  
  9. ------------
  10. Introduction
  11. ------------
  12.  
  13.   This document is an example of how to detect, intercept and enable/disable
  14. the memory resident programs of ThunderBYTE Anti-Virus: TbDriver, TbScanX,
  15. TbCheck, TbMem, TbFile, TbDisk and TbLog.
  16.  
  17. -------------------------------
  18. Thunderbyte B.V. about TbDriver
  19. -------------------------------
  20.  
  21.      Enable memory resident TBAV utilities: TbDriver
  22.  
  23.      TbDriver does not provide much protection against viruses by itself, but
  24.      must be loaded in advance to enable the memory resident ThunderBYTE
  25.      Anti-Virus utilities, such as TbScanX, TbCheck, TbMem, TbFile and TbDisk
  26.      to perform properly. It also provides basic protection against ANSI
  27.      bombs and 'stealth' viruses.
  28.  
  29. -----------------------------
  30. Interrupts hooked by TbDriver
  31. -----------------------------
  32.  
  33. These interrupts are hooked by TbDriver:
  34.  
  35.   INT 20h (DOS Program Terminate)
  36.   INT 21h (DOS Function call)
  37.   INT 27h (DOS Terminate and Stay Resident)
  38.   INT 29h (DOS Fast Console Output)
  39.   INT 2Fh (Software Multiplex)
  40.  
  41. ----------------------
  42. How to detect TbDriver
  43. ----------------------
  44.  
  45. The below code shows an example of how to detect TbDriver:
  46.  
  47. ;------------------------------------------------------------=< cut here >=-
  48.          push    ds                  ; Save DS at stack
  49.          xor     ax,ax               ; Clear AX
  50.          mov     ds,ax               ; DS = segment of interrupt vectors
  51.          lds     si,ds:[29h*04h]     ; Get address of interrupt 29h
  52.          cmp     [si],2e53h          ; TbDriver resident?
  53.          jne     detectexit          ; Not resident? Jump to detectexit
  54.  
  55. ; Intercept TbDriver here...
  56.  
  57. detectexit:
  58.          pop     ds                  ; Load DS from stack
  59. ;------------------------------------------------------------=< cut here >=-
  60.  
  61. This example must be used before interception of TbDriver.
  62.  
  63. -------------------------
  64. How to intercept TbDriver
  65. -------------------------
  66.  
  67.   The below code shows an example of how to intercept all interupts hooked
  68. by TbDriver:
  69.  
  70. ;------------------------------------------------------------=< cut here >=-
  71.          lea     di,int29adr         ; DI = offset of int29adr
  72.          add     si,43h              ; SI = offset of original INT 29h
  73.          movsw                       ; Move address of original INT 29h
  74.          movsw                       ;  "      "    "     "      "   "
  75.  
  76.          lea     di,int2fadr         ; DI = offset of int2fadr
  77.          add     si,17h              ; SI = offset of original INT 2fh
  78.          movsw                       ; Move address of original INT 2fh
  79.          movsw                       ;  "      "    "     "      "   "
  80.  
  81.          lea     di,int21adr         ; DI = offset of int21adr
  82.          add     si,0c4h             ; SI = offset of original INT 21h
  83.          movsw                       ; Move address of original INT 21h
  84.          movsw                       ;  "      "    "     "      "   "
  85.  
  86.          mov     ds,ax               ; DS = segment of interrupt vectors
  87.  
  88.          mov     word ptr ds:[20h*04h],offset int20h
  89.          mov     ds:[20h*04h+02h],es ; Intercept interrupt 20h
  90.  
  91.          mov     word ptr ds:[21h*04h],offset int21h
  92.          mov     ds:[21h*04h+02h],es ; Intercept interrupt 21h
  93.  
  94.          mov     word ptr ds:[27h*04h],offset int27h
  95.          mov     ds:[27h*04h+02h],es ; Intercept interrupt 27h
  96.  
  97.          mov     word ptr ds:[29h*04h],offset int29h
  98.          mov     ds:[29h*04h+02h],es ; Intercept interrupt 29h
  99.  
  100.          mov     word ptr ds:[2fh*04h],offset int2fh
  101.          mov     ds:[2fh*04h+02h],es ; Intercept interrupt 2fh
  102. ;------------------------------------------------------------=< cut here >=-
  103.  
  104. --------------------------------------------------------
  105. Necessary procedures and variables to intercept TbDriver
  106. --------------------------------------------------------
  107.  
  108.   These procedures and variable are necessary to emulate the original
  109. interrupts:
  110.  
  111. ;------------------------------------------------------------=< cut here >=-
  112. int20h       proc    near                ; DOS Program Terminate
  113.          xor     ax,ax               ; Terminate program
  114.          endp
  115.  
  116. int21h       proc    near                ; DOS Function call
  117.          db      0eah                ; Object code of jump far
  118. int21adr     dd      ?                   ; Address of interrupt 21h
  119.          endp
  120.  
  121. int27h       proc    near                ; DOS Terminate and Stay Resident
  122.          mov     ah,31h              ; Terminate and stay resident
  123.          mov     cl,04h              ; Multiply by paragraphs
  124.          shr     dx,cl               ; Calculate paragraphs
  125.          inc     dx                  ; Increase DX
  126.          jmp     short int21h
  127.          endp
  128.  
  129. int29h       proc    near                ; DOS Fast Console Output
  130.          db      0eah                ; Object code of jump far
  131. int29adr     dd      ?                   ; Address of interrupt 29h
  132.          endp
  133.  
  134. int2fh       proc    near                ; Software Multiplex
  135.          db      0eah                ; Object code of jump far
  136. int2fadr     dd      ?                   ; Address of interrupt 2fh
  137.          endp
  138. ;------------------------------------------------------------=< cut here >=-
  139.  
  140. ------------------------------
  141. Thunderbyte B.V. about TbScanX
  142. ------------------------------
  143.  
  144.      Automatic scanning: TbScanX
  145.  
  146.      TbScanX is the memory resident version of TbScan. This signature scanner
  147.      remains resident in memory and automatically scans those files which are
  148.      being executed, copied, de-archived, downloaded, etc. TbScanX does not
  149.      require much memory. It can swap itself into expanded, XMS, or high
  150.      memory, using only 1Kb of conventional memory.
  151.  
  152. ----------------------------
  153. Interrupts hooked by TbScanX
  154. ----------------------------
  155.  
  156. These interrupts are hooked by TbScanX:
  157.  
  158.   INT 13h (BIOS Fixed disk/FDD Services)
  159.   INT 2Fh (Software Multiplex)
  160.  
  161.   It may look like the below interrupt is hooked, because it pointers to the
  162. code of TbScanX, but it is NOT hooked:
  163.  
  164.   INT E1h (BASIC Reserved)
  165.  
  166. ---------------------
  167. How to detect TbScanX
  168. ---------------------
  169.  
  170. The below code shows an example of how to detect TbScanX:
  171.  
  172. ;------------------------------------------------------------=< cut here >=-
  173.          push    ds                  ; Save DS at stack
  174.          xor     ax,ax               ; Clear AX
  175.          mov     ds,ax               ; DS = segment of interrupt vectors
  176.          lds     si,ds:[13h*04h]     ; Get address of interrupt 13h
  177.          cmp     [si],2e9ch          ; TbScanX resident?
  178.          jne     detectexit          ; Not resident? Jump to detectexit
  179.  
  180. ; Enable/disable or intercept TbScanX here...
  181.  
  182. detectexit:
  183.          pop     ds                  ; Load DS from stack
  184. ;------------------------------------------------------------=< cut here >=-
  185.  
  186.   You can't detect or intercept TbScanX probably if TbDisk has hooked the
  187. interrupt before or after, so please detect TbDisk before and after.
  188.  
  189. This example must used before enable/disable or interception of TbScanX.
  190.  
  191. ------------------------
  192. How to intercept TbScanX
  193. ------------------------
  194.  
  195.   The below code shows an example of how to intercept interrupt 13h, which is
  196. hooked by TbScanX:
  197.  
  198. ;------------------------------------------------------------=< cut here >=-
  199.          lea     di,int13adr         ; DI = offset of int13adr
  200.          add     si,66h              ; SI = offset of original INT 13h
  201.          movsw                       ; Move address of original INT 13h
  202.          movsw                       ;  "      "    "     "      "   "
  203.  
  204.          mov     ds,ax               ; DS = segment of interrupt vectors
  205.  
  206.          mov     word ptr ds:[13h*04h],offset int13h
  207.          mov     ds:[13h*04h+02h],es ; Intercept interrupt 13h
  208. ;------------------------------------------------------------=< cut here >=-
  209.  
  210.   It is easier to intercept interrupt 2fh from TbDriver, do that instead of
  211. intercepting it from TbScanX.
  212.  
  213. -------------------------------------------------------
  214. Necessary procedures and variables to intercept TbScanX
  215. -------------------------------------------------------
  216.  
  217.   These procedures and variable are necessary to emulate the original
  218. interrupts:
  219.  
  220. ;------------------------------------------------------------=< cut here >=-
  221. int13h       proc    near                ; BIOS Fixed disk/FDD Services
  222.          db      0eah                ; Object code of jump far
  223. int13adr     dd      ?                   ; Address of interrupt 13h
  224.          endp
  225. ;------------------------------------------------------------=< cut here >=-
  226.  
  227. ---------------------
  228. How to enable TbScanX
  229. ---------------------
  230.  
  231. The below code shows an example of how to enable TbScanX:
  232.  
  233. ;------------------------------------------------------------=< cut here >=-
  234.          mov     byte ptr ds:[si-12ch],00h
  235. ;------------------------------------------------------------=< cut here >=-
  236.  
  237. ----------------------
  238. How to disable TbScanX
  239. ----------------------
  240.  
  241. The below code shows an example of how to disable TbScanX:
  242.  
  243. ;------------------------------------------------------------=< cut here >=-
  244.          mov     byte ptr ds:[si-12ch],19h
  245. ;------------------------------------------------------------=< cut here >=-
  246.  
  247. ------------------------------
  248. Thunderbyte B.V. about TbCheck
  249. ------------------------------
  250.  
  251.      Check while loading: TbCheck
  252.  
  253.      TbCheck is a memory resident integrity checker. This program remains
  254.      resident in memory and checks automatically every file just before it is
  255.      being executed. TbCheck uses a fast integrity checking method, consuming
  256.      only 400 bytes of memory. It can be configured to reject files with
  257.      incorrect checksums, and/or to reject files that do not have a corres-
  258.      ponding Anti-Vir.Dat record.
  259.  
  260. ----------------------------
  261. Interrupts hooked by TbCheck
  262. ----------------------------
  263.  
  264. TbCheck does not hook interrupts.
  265. And therefore you do not need to intercept it.
  266.  
  267. ---------------------
  268. How to detect TbCheck
  269. ---------------------
  270.  
  271. The below code shows an example of how to detect TbCheck:
  272.  
  273. ;------------------------------------------------------------=< cut here >=-
  274.          push    ds                  ; Save DS at stack
  275.          xor     ax,ax               ; Clear AX
  276.          mov     ds,ax               ; DS = segment of interrupt vectors
  277.          lds     si,ds:[21h*04h]     ; Get address of interrupt 21h
  278.          lds     si,ds:[si+75h]      ; Get address of TbCheck
  279.          cmp     [si],3d9ch          ; TbCheck resident?
  280.          jne     detectexit          ; Not resident? Jump to detectexit
  281.  
  282. ; Enable/disable TbCheck here...
  283.  
  284. detectexit:
  285.          pop     ds                  ; Load DS from stack
  286. ;------------------------------------------------------------=< cut here >=-
  287.  
  288.   You can't detect TbCheck probably if TbScanX, TbMem, TbFile, TbDisk or
  289. TbLog has hooked the interrupt before, so please detect them before.
  290.  
  291. This example must used before enable/disable TbCheck.
  292.  
  293. ---------------------
  294. How to enable TbCheck
  295. ---------------------
  296.  
  297. The below code shows an example of how to enable TbCheck:
  298.  
  299. ;------------------------------------------------------------=< cut here >=-
  300.          mov     byte ptr ds:[si-69h],00h
  301. ;------------------------------------------------------------=< cut here >=-
  302.  
  303. ----------------------
  304. How to disable TbCheck
  305. ----------------------
  306.  
  307. The below code shows an example of how to disable TbCheck:
  308.  
  309. ;------------------------------------------------------------=< cut here >=-
  310.          mov     byte ptr ds:[si-69h],01h
  311. ;------------------------------------------------------------=< cut here >=-
  312.  
  313. ----------------------------
  314. Thunderbyte B.V. about TbMem
  315. ----------------------------
  316.  
  317.      Controlling memory: TbMem
  318.  
  319.      TbMem detects attempts from programs to remain resident in memory, and
  320.      ensures that no program can remain resident in memory without permis-
  321.      sion. Since most viruses remain resident in memory, this is a powerful
  322.      weapon against all such viruses, known or unknown. Permission informa-
  323.      tion is maintained in the Anti-Vir.Dat files. TbMem also protects your
  324.      CMOS memory against unwanted modifications.
  325.  
  326. --------------------------
  327. Interrupts hooked by TbMem
  328. --------------------------
  329.  
  330. These interrupts are hooked by TbMem:
  331.  
  332.   INT 09h (IRQ 1  Keyboard)
  333.   INT 2Fh (Software Multiplex)
  334.  
  335. -------------------
  336. How to detect TbMem
  337. -------------------
  338.  
  339. The below code shows an example of how to detect TbMem:
  340.  
  341. ;------------------------------------------------------------=< cut here >=-
  342.          push    ds                  ; Save DS at stack
  343.          xor     ax,ax               ; Clear AX
  344.          mov     ds,ax               ; DS = segment of interrupt vectors
  345.          lds     si,ds:[09h*04h]     ; Get address of interrupt 09h
  346.          cmp     [si],2e50h          ; TbMem resident?
  347.          jne     detectexit          ; Not resident? Jump to detectexit
  348.  
  349. ; Enable/disable or intercept TbMem here...
  350.  
  351. detectexit:
  352.          pop     ds                  ; Load DS from stack
  353. ;------------------------------------------------------------=< cut here >=-
  354.  
  355. This example must used before enable/disable or interception of TbMem.
  356.  
  357. ----------------------
  358. How to intercept TbMem
  359. ----------------------
  360.  
  361.   The below code shows an example of how to intercept interrupt 09h, which is
  362. hooked by TbMem:
  363.  
  364. ;------------------------------------------------------------=< cut here >=-
  365.          lea     di,int09adr         ; DI = offset of int09adr
  366.          add     si,3ch              ; SI = offset of original INT 09h
  367.          movsw                       ; Move address of original INT 09h
  368.          movsw                       ;  "      "    "     "      "   "
  369.  
  370.          mov     ds,ax               ; DS = segment of interrupt vectors
  371.  
  372.          mov     word ptr ds:[09h*04h],offset int09h
  373.          mov     ds:[09h*04h+02h],es ; Intercept interrupt 09h
  374. ;------------------------------------------------------------=< cut here >=-
  375.  
  376.   It is easier to intercept interrupt 2fh from TbDriver, do that instead of
  377. intercepting it from TbMem.
  378.  
  379. -----------------------------------------------------
  380. Necessary procedures and variables to intercept TbMem
  381. -----------------------------------------------------
  382.  
  383.   These procedures and variable are necessary to emulate the original
  384. interrupts:
  385.  
  386. ;------------------------------------------------------------=< cut here >=-
  387. int09h       proc    near                ; IRQ 1  Keyboard
  388.          db      0eah                ; Object code of jump far
  389. int09adr     dd      ?                   ; Address of interrupt 09h
  390.          endp
  391. ;------------------------------------------------------------=< cut here >=-
  392.  
  393. -------------------
  394. How to enable TbMem
  395. -------------------
  396.  
  397. The below code shows an example of how to enable TbMem:
  398.  
  399. ;------------------------------------------------------------=< cut here >=-
  400.          mov     byte ptr ds:[si-253h],28h
  401. ;------------------------------------------------------------=< cut here >=-
  402.  
  403. --------------------
  404. How to disable TbMem
  405. --------------------
  406.  
  407. The below code shows an example of how to disable TbMem:
  408.  
  409. ;------------------------------------------------------------=< cut here >=-
  410.          mov     byte ptr ds:[si-253h],29h
  411. ;------------------------------------------------------------=< cut here >=-
  412.  
  413. -----------------------------
  414. Thunderbyte B.V. about TbFile
  415. -----------------------------
  416.  
  417.      Preventing infection: TbFile
  418.  
  419.      TbFile detects attempts from programs to infect other programs. It also
  420.      guards read-only attributes, detects illegal time-stamps, etc. It will
  421.      make sure that no virus succeeds in infecting programs.
  422.  
  423. ---------------------------
  424. Interrupts hooked by TbFile
  425. ---------------------------
  426.  
  427. TbFile does not hook interrupts.
  428. And therefore you do not need to intercept it.
  429.  
  430. --------------------
  431. How to detect TbFile
  432. --------------------
  433.  
  434. The below code shows an example of how to detect TbFile:
  435.  
  436. ;------------------------------------------------------------=< cut here >=-
  437.          push    ds                  ; Save DS at stack
  438.          xor     ax,ax               ; Clear AX
  439.          mov     ds,ax               ; DS = segment of interrupt vectors
  440.          lds     si,ds:[21h*04h]     ; Get address of interrupt 21h
  441.          lds     si,ds:[si+75h]      ; Get address of TbFile
  442.          cmp     [si],2e9ch          ; TbFile resident?
  443.          jne     detectexit          ; Not resident? Jump to detectexit
  444.  
  445. ; Enable/disable TbFile here...
  446.  
  447. detectexit:
  448.          pop     ds                  ; Load DS from stack
  449. ;------------------------------------------------------------=< cut here >=-
  450.  
  451.   You can't detect TbFile probably if TbScanX, TbCheck, TbMem, TbDisk or
  452. TbLog has hooked the interrupt before, so please detect them before.
  453.  
  454. This example must used before enable/disable TbFile.
  455.  
  456. --------------------
  457. How to enable TbFile
  458. --------------------
  459.  
  460. The below code shows an example of how to enable TbFile:
  461.  
  462. ;------------------------------------------------------------=< cut here >=-
  463.          mov     byte ptr ds:[si-0c5h],00h
  464. ;------------------------------------------------------------=< cut here >=-
  465.  
  466. ---------------------
  467. How to disable TbFile
  468. ---------------------
  469.  
  470. The below code shows an example of how to disable TbFile:
  471.  
  472. ;------------------------------------------------------------=< cut here >=-
  473.          mov     byte ptr ds:[si-0c5h],01h
  474. ;------------------------------------------------------------=< cut here >=-
  475.  
  476. -----------------------------
  477. Thunderbyte B.V. about TbDisk
  478. -----------------------------
  479.  
  480.      Protecting the disk: TbDisk
  481.  
  482.      TbDisk is a disk guard program which detects attempts from programs to
  483.      write directly to disk (without using DOS), attempts to format, etc.,
  484.      and makes sure that no malicious program will succeed in destroying your
  485.      data. This utility also traps tunneling and direct calls into the BIOS
  486.      code. Permission information about the rare programs that write directly
  487.      and/or format the disk is maintained in the Anti-Vir.Dat files.
  488.  
  489. ---------------------------
  490. Interrupts hooked by TbDisk
  491. ---------------------------
  492.  
  493. These interrupts are hooked by TbDisk:
  494.  
  495.   INT 13h (BIOS Fixed disk/FDD Services)
  496.   INT 15h (BIOS System Services)
  497.   INT 26h (DOS Absolute Disk Write)
  498.   INT 2Fh (Software Multiplex)
  499.   INT 40h (BIOS Diskette Service)
  500.  
  501. --------------------
  502. How to detect TbDisk
  503. --------------------
  504.  
  505. The below code shows an example of how to detect TbDisk:
  506.  
  507. ;------------------------------------------------------------=< cut here >=-
  508.          push    ds                  ; Save DS at stack
  509.          xor     ax,ax               ; Clear AX
  510.          mov     ds,ax               ; DS = segment of interrupt vectors
  511.          lds     si,ds:[26h*04h]     ; Get address of interrupt 26h
  512.          cmp     [si],2e9ch          ; TbDisk resident?
  513.          jne     detectexit          ; Not resident? Jump to detectexit
  514.  
  515. ; Enable/disable or intercept TbDisk here...
  516.  
  517. detectexit:
  518.          pop     ds                  ; Load DS from stack
  519. ;------------------------------------------------------------=< cut here >=-
  520.  
  521.   You can't detect or intercept TbDisk probably if TbScanX has hooked the
  522. interrupt before or after, so please detect TbScanX before and after.
  523.  
  524. This example must used before enable/disable or interception of TbDisk.
  525.  
  526. -----------------------
  527. How to intercept TbDisk
  528. -----------------------
  529.  
  530.   The below code shows an example of how to intercept interrupt 13h, 15h, 26h
  531. and 40h, which is hooked by TbDisk:
  532.  
  533. ;------------------------------------------------------------=< cut here >=-
  534.          lea     di,int26adr         ; DI = offset of int26adr
  535.          add     si,0fh              ; SI = offset of original INT 26h
  536.          movsw                       ; Move address of original INT 26h
  537.          movsw                       ;  "      "    "     "      "   "
  538.  
  539.          lea     di,int40adr         ; DI = offset of int40adr
  540.          add     si,18h              ; SI = offset of original INT 40h
  541.          movsw                       ; Move address of original INT 40h
  542.          movsw                       ;  "      "    "     "      "   "
  543.  
  544.          lea     di,int13adr         ; DI = offset of int13adr
  545.          add     si,2bh              ; SI = offset of original INT 13h
  546.          movsw                       ; Move address of original INT 13h
  547.          movsw                       ;  "      "    "     "      "   "
  548.  
  549.          lea     di,int15adr         ; DI = offset of int15adr
  550.          add     si,18h              ; SI = offset of original INT 15h
  551.          movsw                       ; Move address of original INT 15h
  552.          movsw                       ;  "      "    "     "      "   "
  553.  
  554.          mov     ds,ax               ; DS = segment of interrupt vectors
  555.  
  556.          mov     word ptr ds:[13h*04h],offset int13h
  557.          mov     ds:[13h*04h+02h],es ; Intercept interrupt 13h
  558.  
  559.          mov     word ptr ds:[15h*04h],offset int15h
  560.          mov     ds:[15h*04h+02h],es ; Intercept interrupt 15h
  561.  
  562.          mov     word ptr ds:[26h*04h],offset int26h
  563.          mov     ds:[26h*04h+02h],es ; Intercept interrupt 26h
  564.  
  565.          mov     word ptr ds:[40h*04h],offset int40h
  566.          mov     ds:[40h*04h+02h],es ; Intercept interrupt 40h
  567. ;------------------------------------------------------------=< cut here >=-
  568.  
  569.   It is easier to intercept interrupt 2fh from TbDriver, do that instead of
  570. intercepting it from TbDisk.
  571.  
  572. ------------------------------------------------------
  573. Necessary procedures and variables to intercept TbDisk
  574. ------------------------------------------------------
  575.  
  576.   These procedures and variable are necessary to emulate the original
  577. interrupts:
  578.  
  579. ;------------------------------------------------------------=< cut here >=-
  580. int13h       proc    near                ; BIOS Fixed disk/FDD Services
  581.          db      0eah                ; Object code of jump far
  582. int13adr     dd      ?                   ; Address of interrupt 13h
  583.          endp
  584.  
  585. int15h       proc    near                ; BIOS System Services
  586.          db      0eah                ; Object code of jump far
  587. int15adr     dd      ?                   ; Address of interrupt 15h
  588.          endp
  589.  
  590. int26h       proc    near                ; DOS Absolute Disk Write
  591.          db      0eah                ; Object code of jump far
  592. int26adr     dd      ?                   ; Address of interrupt 26h
  593.          endp
  594.  
  595. int40h       proc    near                ; BIOS Diskette Service
  596.          db      0eah                ; Object code of jump far
  597. int40adr     dd      ?                   ; Address of interrupt 40h
  598.          endp
  599. ;------------------------------------------------------------=< cut here >=-
  600.  
  601. --------------------
  602. How to enable TbDisk
  603. --------------------
  604.  
  605. The below code shows an example of how to enable TbDisk:
  606.  
  607. ;------------------------------------------------------------=< cut here >=-
  608.          mov     byte ptr ds:[si-0bah],00h
  609. ;------------------------------------------------------------=< cut here >=-
  610.  
  611. ---------------------
  612. How to disable TbDisk
  613. ---------------------
  614.  
  615. The below code shows an example of how to disable TbDisk:
  616.  
  617. ;------------------------------------------------------------=< cut here >=-
  618.          mov     byte ptr ds:[si-0bah],01h
  619. ;------------------------------------------------------------=< cut here >=-
  620.  
  621. ----------------------------
  622. Thunderbyte B.V. about TbLog
  623. ----------------------------
  624.  
  625.      The purpose of TbLog
  626.  
  627.      TbLog is a TBAV log file utility. It writes a record into a log file
  628.      whenever one of the resident TBAV utilities pops up with an alert
  629.      message. Also when TbScan detects a virus a record will be written.
  630.  
  631. --------------------------
  632. Interrupts hooked by TbLog
  633. --------------------------
  634.  
  635. This interrupt is hooked by TbLog:
  636.  
  637.   INT 2Fh (Software Multiplex)
  638.  
  639.   It is easier to intercept interrupt 2fh from TbDriver, do that instead of
  640. intercepting it from TbLog.
  641.  
  642. -------------------
  643. How to detect TbLog
  644. -------------------
  645.  
  646. The below code shows an example of how to detect TbLog:
  647.  
  648. ;------------------------------------------------------------=< cut here >=-
  649.          push    ds                  ; Save DS at stack
  650.          xor     ax,ax               ; Clear AX
  651.          mov     ds,ax               ; DS = segment of interrupt vectors
  652.          lds     si,ds:[2fh*04h]     ; Get address of interrupt 2fh
  653.          cmp     [si],0fd3dh         ; TbLog resident?
  654.          jne     detectexit          ; Not resident? Jump to detectexit
  655.  
  656. ; Enable/disable TbLog here...
  657.  
  658. detectexit:
  659.          pop     ds                  ; Load DS from stack
  660. ;------------------------------------------------------------=< cut here >=-
  661.  
  662.   You can't detect TbLog probably if TbScanX, TbMem or TbDisk has hooked the
  663. interrupt before, so please detect them before.
  664.  
  665. This example must used before enable/disable TbLog.
  666.  
  667. -------------------
  668. How to enable TbLog
  669. -------------------
  670.  
  671. The below code shows an example of how to enable TbLog:
  672.  
  673. ;------------------------------------------------------------=< cut here >=-
  674.          mov     byte ptr ds:[si-0a2h],00h
  675. ;------------------------------------------------------------=< cut here >=-
  676.  
  677. --------------------
  678. How to disable TbLog
  679. --------------------
  680.  
  681. The below code shows an example of how to disable TbLog:
  682.  
  683. ;------------------------------------------------------------=< cut here >=-
  684.          mov     byte ptr ds:[si-0a2h],01h
  685. ;------------------------------------------------------------=< cut here >=-
  686.  
  687. ---------------------
  688. Final tips and tricks
  689. ---------------------
  690.  
  691. - These examples were tested with ThunderBYTE Anti-Virus v 6.31.
  692. - Only intercept those interrupts the virus uses.
  693. - Use a lot anti-heuristic's, so other programs can't find the virus either.
  694. - Remember to optimize your code.
  695.  
  696.